/************************************************
 *** Datei: UIController.h
 ***
 *** Erstellt am: 16.05.2012
 ***       Autor: Max Stark <Max.Stark88@googlemail.com>
 ***	 Version: 1.0
 ***	
 *** Beschreibung:
 *** <hier Beschreibung einfuegen>
 ************************************************/

#ifndef UICONTROLLER_H_
#define UICONTROLLER_H_


#include <vector>
using namespace std;
#include <boost/thread.hpp>
using namespace boost;
#include "../view/IDroneSwarmUI.h"
#include "../model/IDrone.h"
#include "../model/IDroneNavData.h"
class DroneSwarmController;
struct DroneListEntry;

#define UPDATE_DRONELIST		1
#define UPDATE_INPUTDEVICELIST	2
#define UPDATE_DRONENAVDATA		3

class UIController {

	DroneSwarmController* 	dsController;
	vector<IDroneSwarmUI*>* uiObserverList;

	thread* triggerUpdateDroneNavDataThread;
	bool 	triggerUpdateDroneNavDataThread_Active;
	void 	triggerUpdateDroneNavData();

public:
	UIController(DroneSwarmController* dsController);
	virtual ~UIController();

	void attachUIObserver(IDroneSwarmUI* uiObserver);
	void triggerUpdate(int update);

	void connectDrone();
	void disconnectDrone();
	void sendMasterMessage(int index);

	vector<DroneListEntry>* getDroneList();
	IDrone* getDrone();
	IDroneNavData* getDroneNavData();
};

#endif /* UICONTROLLER_H_ */
